package com.example.analysis.controller;

import com.example.analysis.entity.StudentAbility;
import com.example.analysis.entity.StudentWarning;
import com.example.analysis.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/teacher")
public class TeacherController {

    private final TeacherService teacherService;

    @Autowired
    public TeacherController(TeacherService teacherService) {
        this.teacherService = teacherService;
    }

    // 获取班级学生能力维度数据
    @GetMapping("/classStudentAbilities")
    public List<StudentAbility> getClassStudentAbilities(@RequestParam String classId) {
        return teacherService.getClassStudentAbilities(classId);
    }

    // 获取预警学生列表
    @GetMapping("/studentsWithWarnings")
    public List<StudentWarning> getStudentsWithWarnings(@RequestParam String classId) {
        return teacherService.getStudentsWithWarnings(classId);
    }

    // 提供学业指导意见
    @PostMapping("/provideGuidance")
    public void provideGuidance(@RequestParam String studentId, @RequestParam String guidance) {
        teacherService.provideGuidance(studentId, guidance);
    }
}

